<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      Fetchmail-6.4.2
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;19.&nbsp;Mail/News Clients
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="mailnews.html" title=
          "Mail/News Clients">Prev</a>
          <p>
            Mail/News Clients
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="mailx.html" title="mailx-12.5">Next</a>
          <p>
            mailx-12.5
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="mailnews.html" title=
          "Chapter&nbsp;19.&nbsp;Mail/News Clients">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="fetchmail" name="fetchmail"></a>Fetchmail-6.4.2
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to Fetchmail
        </h2>
        <p>
          The <span class="application">Fetchmail</span> package contains a
          mail retrieval program. It retrieves mail from remote mail servers
          and forwards it to the local (client) machine's delivery system, so
          it can then be read by normal mail user agents.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://downloads.sourceforge.net/fetchmail/fetchmail-6.4.2.tar.xz">
                https://downloads.sourceforge.net/fetchmail/fetchmail-6.4.2.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 039b49a4f41f8544a51d82d2f4599dfc
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 1.3 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 16 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.1 SBU
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Fetchmail Dependencies
        </h3>
        <h4>
          Recommended
        </h4>
        <p class="recommended">
          a local MDA (<a class="xref" href="procmail.html" title=
          "Procmail-3.22">Procmail-3.22</a>)
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="../postlfs/mitkrb.html" title=
          "MIT Kerberos V5-1.18">MIT Kerberos V5-1.18</a>, <a class="ulink"
          href=
          "http://www.citi.umich.edu/projects/nfsv4/linux/">libgssapi</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/fetchmail">http://wiki.linuxfromscratch.org/blfs/wiki/fetchmail</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of Fetchmail
        </h2>
        <p>
          Create a dedicated user for the fetchmail program. Issue the
          following commands as the <code class="systemitem">root</code>
          user:
        </p>
        <pre class="root">
<kbd class="command">useradd -c "Fetchmail User" -d /dev/null -g nogroup \
        -s /bin/false -u 38 fetchmail</kbd>
</pre>
        <p>
          Install <span class="application">Fetchmail</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">PYTHON=python3 \
./configure --prefix=/usr \
 --enable-fallback=procmail &amp;&amp;
make</kbd>
</pre>
        <p>
          To test the results, issue: <span class="command"><strong>make
          check</strong></span>.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install                                  &amp;&amp;
chown -v fetchmail:nogroup /usr/bin/fetchmail</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <em class="parameter"><code>PYTHON=python3</code></em>: a version
          of Python is <span class="emphasis"><em>required</em></span>, but
          only used to install a module to allow fetchmailconf to be run.
          That module is unmaintained and should not be used.
        </p>
        <p>
          <em class="parameter"><code>--enable-fallback=procmail</code></em>:
          This tells <span class="application">Fetchmail</span> to hand
          incoming mail to <span class="application">Procmail</span> for
          delivery, if the port 25 mail server is not present or not
          responding.
        </p>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring Fetchmail
        </h2>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="fetchmail-config" name="fetchmail-config"></a>
          </h3>
          <h4 class="title">
            <a id="fetchmail-config" name="fetchmail-config"></a>Config Files
          </h4>
          <p>
            <code class="filename">~/.fetchmailrc</code>
          </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3"></h3>
          <h4 class="title">
            <a id="idm140006438701520" name=
            "idm140006438701520"></a>Configuration Information
          </h4>
          <pre class="userinput">
<kbd class="command">cat &gt; ~/.fetchmailrc &lt;&lt; "EOF"
<code class="literal">
# The logfile needs to exist when fetchmail is invoked, otherwise it will
# dump the details to the screen. As with all logs, you will need to rotate
# or clear it from time to time.
set logfile fetchmail.log
set no bouncemail
# You probably want to set your local username as the postmaster
set postmaster <em class="replaceable"><code>&lt;username&gt;</code></em>

poll SERVERNAME :
    user <em class=
"replaceable"><code>&lt;isp_username&gt;</code></em> pass <em class=
"replaceable"><code>&lt;password&gt;</code></em>;
    mda "/usr/bin/procmail -f %F -d %T";</code>
EOF

touch ~/fetchmail.log       &amp;&amp;
chmod -v 0600 ~/.fetchmailrc</kbd>
</pre>
          <p>
            This is an example configuration that should suffice for most
            people. You can add as many users and servers as you need using
            the same syntax.
          </p>
          <p>
            <span class="command"><strong>man fetchmail</strong></span>: Look
            for the section near the bottom named <span class=
            "emphasis"><em>CONFIGURATION EXAMPLES</em></span>. It gives some
            quick examples. There are countless other configuration options
            once you get used to it.
          </p>
          <p>
            If you expect to receive very little mail you can invoke
            fetchmail when you wish to receive any incoming mail. More
            commonly, it is either invoked in daemon mode with the
            <code class="literal">-d</code> option either on the command
            line, or in <code class="filename">.fetchmailrc</code> (see
            'DAEMON MODE' in man fetchmailconf), or alternatively it is
            invoked from a cron job.
          </p>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">fetchmail and fetchmailconf</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">None</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">None</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="fetchmail-prog" name=
                    "fetchmail-prog"></a><span class="term"><span class=
                    "command"><strong>fetchmail</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    when executed as a user, this will source <code class=
                    "filename">~/.fetchmailrc</code> and download the
                    appropriate mail.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="fetchmailconf" name=
                    "fetchmailconf"></a><span class="term"><span class=
                    "command"><strong>fetchmailconf</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is an unmaintained GUI command to assist in creating a
                    <code class="filename">~/.fetchmailrc</code>
                    configuration file and should not be used.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-23 16:46:15 -0500
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="mailnews.html" title=
          "Mail/News Clients">Prev</a>
          <p>
            Mail/News Clients
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="mailx.html" title="mailx-12.5">Next</a>
          <p>
            mailx-12.5
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="mailnews.html" title=
          "Chapter&nbsp;19.&nbsp;Mail/News Clients">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
